export class Upload {
  public picObj: object;

  constructor(){
    this.picObj = {};
  }
  // 上传
  up(){
    let input = document.getElementById("file");
    if(input.files){
      //读取图片数据
      let f = input.files[0];
        let reader = new FileReader();

        reader.onload = function (e) {
          let data = e.target.result;

          let image = new Image();
          image.onload=function(){
              let width = image.width;
              let height = image.height;
              console.log(width+'======'+height+"====="+f.size);
          };
          image.src= data;
        };
          reader.readAsDataURL(f);
    }else{
      let image = new Image();

      image.onload =function(){
        let width = image.width;
        let height = image.height;
        let fileSize = image.fileSize;
        console.log(width+'======'+height+"====="+fileSize);
      }
      image.src = input.value;
    }
  }
  // 缩略图
  private getPicThumb(){

  }
  // 获取文件名
  private getPicName(){

  }
  // 获取文件的扩展名
  private getPicExt(){

  }
  // 获取文件的宽
  private getPicWidth(){

  }
  // 获取文件的高
  private getPicHeight(){

  }
  // 获取文件大小
  private getPicSize(){

  }
  // 获取文件像素
  private getPicPixel(){

  }
};
